<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js + TypeScript App" @add-feature="onAddFeature"/>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src
import { Feature } from "@/types";

@Component({
  // 8. 使用组件
  components: {
    HelloWorld,
  },
})
export default class Home extends Vue {
  onAddFeature(f: Feature) {
    console.log('新增属性', f.name)
  }
}
</script>
